#ifndef _SCENEOBJECT_HEADER_
#define _SCENEOBJECT_HEADER_
#include "Mesh.h"
#include "Material.h"
#include "Entity.h"
#include "Shader.h"
#include <string>
#include <vector>
#include <list>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

using namespace glm;

struct LODModel{
	int id;
	float dist;
	string fileName;
};

struct ModelProperties{
	bool animated;
	bool nocull;
	string model;
	list<LODModel> lods;
};

class SceneObject : public Entity{
public:
	SceneObject();
	SceneObject(int id, bool stat, glm::vec3 pos, glm::vec3 rot, glm::vec3 sca, Material mat, string matName, list<std::string> modelProps, string mdlName);
	virtual void Draw();
	virtual void Think();
	Material* GetMaterial();
	void AssignMaterial(Material nMat);
	void LoadModel(list<std::string> modelProps, std::string mdlName);
	void LoadLODs();
	int GetPrimCount();
	ModelProperties GetProperties();
	int GetVerts();
private:
	float thinkTimer;
	Material material;
	vector<Mesh> meshes;
	list<LODModel> LODInfo;
	list<Mesh> LodModels;
	ModelProperties model_properties;
	void ProcessNode(aiNode* node, const aiScene* scene);
	Mesh ProcessMesh(aiMesh* mesh, const aiScene* scene);
	string modelDir;

	// base uniform locations
	GLuint modelUniLoc;
	GLuint viewUniLoc;
	GLuint projUniLoc;
	GLuint colourUniLoc;
	GLuint tilingUniLoc;
protected:

};

#endif // _SCENEOBJECT_HEADER_